﻿<%@ Page Title="Manage Sell Offers" Language="C#" MasterPageFile="~/ManagerView.master"
    AutoEventWireup="true" CodeBehind="PageSupplierManager.aspx.cs" Inherits="BestBuy.PageAdmin.PageSupplierManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <table width="100%" align="center">
        <tr>
            <td colspan="2" class="td_center">
                <h1>
                    <asp:Label ID="lbInfo" runat="server" Text="Manage Sell Offers"></asp:Label>
                </h1>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <table width="100%">
                    <tr>
                        <td class="td_fitter">
                            Status :
                            <asp:DropDownList ID="cbbStatus" runat="server" Width="175px" Height="27px" 
                                AutoPostBack="true" onselectedindexchanged="cbbStatus_SelectedIndexChanged"
                                >
                                <asp:ListItem Value="-2" Text="All" />
                                <asp:ListItem Value="0" Text="Unverified" />
                                <asp:ListItem Value="1" Text="Active" />
                                <asp:ListItem Value="2" Text="ExpiryTime" />
                                <asp:ListItem Value="3" Text="Disapproved" />
                                <asp:ListItem Value="3" Text="Disapproved" />
                                <asp:ListItem Value="-1" Text="Deleted" />
                            </asp:DropDownList>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <asp:LinkButton ID="lbtnActive" CssClass="style_button" Style="margin-left: 10px;
                    cursor: pointer;" OnClientClick="javascript:return confirm('Are you sure you want to active?');"
                    CausesValidation="false" runat="server" Text="Active" 
                    onclick="lbtnActive_Click" > </asp:LinkButton>
                <asp:LinkButton ID="lbtnDelete" CssClass="style_button" Style="margin-left: 10px;
                    cursor: pointer;" OnClientClick="javascript:return confirm('Are you sure you want to delete?');"
                    CausesValidation="false" runat="server" Text="Delete" 
                    onclick="lbtnDelete_Click" > </asp:LinkButton>
            </td>
            <td class="td_right" style="margin-right: 20px; width: 50%;">
                <asp:Panel ID="pnPhanTrang" runat="server">
                    <asp:LinkButton ID="lbtnBegin" runat="server" CssClass="pagePhanTrang" ToolTip="First"
                        Text="<<" onclick="lbtnBegin_Click" ></asp:LinkButton>
                    <asp:LinkButton ID="lbtnPre" runat="server" CssClass="pagePhanTrang" ToolTip="Previous"
                        Text="<" onclick="lbtnPre_Click" ></asp:LinkButton>
                    <asp:Label ID="lbPages" runat="Server" Text="Pages :"></asp:Label>
                    <asp:TextBox ID="txtTrangHienTai" CssClass="txtTrangHienTai" runat="server" Height="13px"
                        Width="50px" MaxLength="7">1</asp:TextBox>
                    <span class="canh_deu">/</span>
                    <asp:Label ID="lbTrang" runat="server"></asp:Label>
                    <asp:RegularExpressionValidator runat="server" ID="valNumbersOnly" CssClass="error"
                        ControlToValidate="txtTrangHienTai" Display="Dynamic" ErrorMessage="Just enter a positive integer."
                        ValidationExpression="(^(?=\d*[1-9])\d+$)">
                    </asp:RegularExpressionValidator>
                    <asp:LinkButton ID="lbtnNext" runat="server" CssClass="pagePhanTrang" ToolTip="Next"
                        Text=">" onclick="lbtnNext_Click" ></asp:LinkButton>
                    <asp:LinkButton ID="lbtnEnd" runat="server" CssClass="pagePhanTrang" ToolTip="Last"
                        Text=">>" onclick="lbtnEnd_Click" ></asp:LinkButton>
                    <asp:LinkButton ID="lbtnToi" CssClass="style_button" Style="margin-left: 5px; cursor: pointer;"
                        CausesValidation="True" runat="server" Text="Go" onclick="lbtnToi_Click" >
                    </asp:LinkButton>
                </asp:Panel>
            </td>
        </tr>
    </table>
    <%-- Danh sách --%>
    <br />
    <asp:Panel ID="pnError" runat="server">
        <asp:Label ID="lbError" runat="server"></asp:Label>
    </asp:Panel>
    <asp:Panel ID="pnEmtry" runat="server">
        <asp:Label ID="lbGridViewEmtry" runat="Server"></asp:Label>
    </asp:Panel>
    <asp:GridView ID="gridview" runat="server" HeaderStyle-CssClass="gridview_header"
        CssClass="gridview" AutoGenerateColumns="false" DataKeyNames="IDBangTinBan" GridLines="None"
        PageSize="15" PagerSettings-FirstPageText="<<">
        <Columns>
            <asp:TemplateField HeaderText="Check All" HeaderStyle-Width="40">
                <ItemTemplate>
                    <asp:CheckBox ID="chkXoa" runat="server" />
                </ItemTemplate>
                <HeaderTemplate>
                    <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this, 'chkXoa');" runat="server"
                        type="checkbox" name="All" style="color: White; margin: -4px 5px 0px 5px;" />All
                </HeaderTemplate>
                <HeaderStyle Width="40px"></HeaderStyle>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="ID">
                <ItemTemplate>
                    <asp:Label ID="lbID" runat="server" Text='<%#Eval("IDBangTinBan")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Subject">
                <ItemTemplate>
                    <asp:Label ID="lbTitle" runat="server" Text='<%#Eval("TieuDe")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Keywords">
                <ItemTemplate>
                    <asp:Label ID="lbKeywords" runat="server" Text='<%#Eval("TuKhoa")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Creation Date">
                <ItemTemplate>
                    <asp:Label ID="lbCreationdate" runat="server" Text='<%#Eval("NgayDang")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Expiry Time">
                <ItemTemplate>
                    <asp:Label ID="lbExpiryTime" runat="server" Text='<%# Eval("ThoiHanDang") + " days" %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Status">
                <ItemTemplate>
                    <asp:Label ID="lbStatus" runat="server" Text='<%# CheckStatus(Eval("TinhTrang")) %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="See More">
                <ItemTemplate>
                    <asp:LinkButton ID="lnkPopup" Style="margin-left: 20px; cursor: pointer;" runat="server"
                        CausesValidation="false" onclick="lnkPopup_Click" >See more</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <HeaderStyle CssClass="gridview_header"></HeaderStyle>
        <PagerSettings FirstPageText="&lt;&lt;"></PagerSettings>
    </asp:GridView>
    <asp:Button ID="btnHidden" runat="Server" Style="display: none" />
    <ajaxToolkit:ModalPopupExtender ID="mpeSanPham" runat="server" TargetControlID="btnHidden"
        PopupControlID="panEdit" BackgroundCssClass="md_background" CancelControlID="btnCancel">
    </ajaxToolkit:ModalPopupExtender>
    <asp:Panel ID="panEdit" runat="server" Height="420px" Width="800px" CssClass="InLeft md_window">
        <h1 class="InTop">
            Information</h1>
        <table class="table_CSP">
            <tr>
                <td class="td_right_popup">
                    ID:
                </td>
                <td class="td_left_popup">
                    <asp:Label ID="lbID" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="td_right_popup">
                    Subject:
                </td>
                <td class="td_left_popup">
                    <asp:Label ID="lbSubject" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="td_right_popup">
                    Keywords:
                </td>
                <td class="td_left_popup">
                    <asp:Label ID="lbKeywords" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="td_right_popup">
                    Creation Date:
                </td>
                <td class="td_left_popup">
                    <asp:Label ID="lbCreationDate" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="td_right_popup">
                    Expiry Time:
                </td>
                <td class="td_left_popup">
                    <asp:Label ID="lbExpiryTime" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="td_right_popup">
                    Ability To Provide:
                </td>
                <td class="td_left_popup">
                    <asp:Label ID="lbAbilityToProvide" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="td_right_popup">
                    Minimum Order Quantity:
                </td>
                <td class="td_left_popup">
                    <asp:Label ID="lbMinimumOrderQuantity" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="td_right_popup">
                    Made in:
                </td>
                <td class="td_left_popup">
                    <asp:Label ID="lbMadein" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="td_right_popup">
                    Descriptions:
                </td>
                <td class="td_left_popup">
                    <asp:Label ID="lbDescriptions" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="td_right_popup">
                </td>
                <td class="td_left_popup">
                    <asp:LinkButton ID="lbtnPopupActive" CssClass="style_button" Style="margin-left: 10px;
                        cursor: pointer;" OnClientClick="javascript:return confirm('Are you sure you want to active?');"
                        CausesValidation="false" runat="server" Text="Active" 
                        onclick="lbtnPopupActive_Click" > </asp:LinkButton>
                    <asp:LinkButton ID="lbtnPopupDelete" CssClass="style_button" Style="margin-left: 10px;
                        cursor: pointer;" OnClientClick="javascript:return confirm('Are you sure you want to delete?');"
                        CausesValidation="false" runat="server" Text="Delete" 
                        onclick="lbtnPopupDelete_Click" > </asp:LinkButton>
                    <asp:Button ID="btnCancel" runat="server" CssClass="style_button" Style="margin-left: 10px;
                        cursor: pointer;" Text="Close" CausesValidation="false" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
